home *** CD-ROM | disk | FTP | other *** search
- /*
- File: HWSpecific.h
-
- Contains: This file contains macros and structures for the ABC Vendor
- Ethernet DLPI.
-
- Written by:
-
- Copyright: © 1993-1994, 1996-1997 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <FW8> 1/9/97 ES Took out some debugging stuff. Removed fixed address allocation.
- <FW7> 12/27/96 ES Changed fwDriverID to fwUnitID and added unitConnection flag to
- DLPIPrivateData.
- <FW6> 12/27/96 ES Changed a bunch of "FWDriver"s to "FWClient"s. Changed to
- protocol driver.
- <FW5> 8/26/96 ES Changed to new command object interface.
- <FW4> 6/20/96 ES Made this look more like a .i generated interface.
- <FW3> 3/29/96 ES Removed all debug strs.
- <FW2> 3/29/96 ES Changed debug str defines so we don't get compiler warnings.
- Took out some unused defs.
- <FW1> 3/27/96 ES first checked in
-
- To Do:
- */
-
- #ifndef __HWSPECIFIC__
- #define __HWSPECIFIC__
-
- #ifndef __FIREWIRE__
- #include <FireWire.h>
- #endif
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #if PRAGMA_IMPORT_SUPPORTED
- #pragma import on
- #endif
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=mac68k
- #endif
-
- /*zzz*/
- #define DebugStrErr(x) strlen ((const char *) x)
- //zzz#define DebugStrErr(x) DebugStr ((ConstStr255Param) x)
-
- #define DebugStr1(x) strlen ((const char *) x)
- //zzz#define DebugStr1(x) DebugStr ((ConstStr255Param) x)
-
- #define DebugStr2(x) strlen ((const char *) x)
- //zzz#define DebugStr2(x) DebugStr ((ConstStr255Param) x)
- /*zzz*/
-
- #define kPCIDeviceInfoName "\pfw617070,6f7464" // pascal string,vendor ID & device id
- #define kModuleDeviceInfoName "fw617070,6f7464" // c string, vendor ID & device id
- #define kModuleDriverFragName "\pOTModl$fw617070,6f7464"
-
- enum
- {
- kMaxTransmitSize = 900
- };
-
- //-----------------------------------------------------------------------------------------
- // Generic enums
- //-----------------------------------------------------------------------------------------
-
- enum BooleanStates
- {
- kFalse = 0,
- kTrue = 1
- };
-
- enum InterruptStates
- {
- kNoInterrupts = 0,
- kTxInterrupts = 1,
- kRxInterrupts = 2,
- kBothTxRxInterrupts = 3
- };
-
- //-----------------------------------------------------------------------------------------
- // Private driver flags for privateFlags variable in dlpiPrivateData
- //-----------------------------------------------------------------------------------------
- #define kpfFraming8022 0x00000001
-
- //-----------------------------------------------------------------------------------------
- // DLPI Private Data structure
- //-----------------------------------------------------------------------------------------
-
- struct DLPITransmitPacketCommandStruct
- {
- struct DLPITransmitPacketCommandStruct
- *pNextDLPITransmitPacketCommand;
- Ptr transmitBuffer;
- UInt32 packetSize;
- };
- typedef struct DLPITransmitPacketCommandStruct DLPITransmitPacketCommand, *DLPITransmitPacketCommandPtr;
-
- struct DLPIPrivateData
- {
- UInt32 privateFlags; // 32 1 bit flags for driver usage
- QHdr dlpiStreamsQueue; // linked list of active streams
- QHdr RxPacketQueue; // linked list of received packets
- QHdr TxPacketQueue; // linked list of packets to transmit
- UInt8 ourEAddress[6]; // store our Ethernet address
- SInt32 TxDeferredTaskCookie;
- SInt32 RxDeferredTaskCookie;
- RegEntryID nodeEntryID; // our entry in the Name Registry
- UInt32 cardBaseAddr; // only necessary for memory mapped cards
- UInt16 currentMinorDeviceNumber; // minor device number used in open
- QHdrPtr transmitPacketQueue; // Queued transmit packet commands.
- FWCommandObjectID asynchCommandObjectID; // Command object for sending FireWire asynchronous packets.
- FWUnitID fwUnitID; // ID of connected FireWire unit.
- Boolean unitConnection; // True if we've added a connection to unit.
- FWPDriverID fwPDriverID; // ID of this FireWire protocol driver.
- FWAddress localAddress, // Local write address.
- targetAddress; // Target write address.
- Ptr transmitBuffer; // Buffer used for transmission.
- Ptr receiveBuffer; // Buffer used for reception.
- UInt32 rxInterruptsOn; // Receive interrupts are on.
- UInt32 txInterruptsOn; // Transmit interrupts are on.
- };
-
- typedef struct DLPIPrivateData DLPIPrivateData;
-
- //-----------------------------------------------------------------------------------------
- // Function Prototypes
- //-----------------------------------------------------------------------------------------
-
- void EnqueueElementAtHead(QHdr *theQHdr, QElem *theElem, UInt16 whichIntsOff);
- void EnqueueElement(QHdr *theQHdr, QElem *theElem, UInt16 whichIntsOff);
- QElem *DequeueHead(QHdr *theHdr, UInt16 whichIntsOff);
- QElem *DequeueElement(QHdr *theQHdr, QElem *theElem, UInt16 whichIntsOff);
-
-
- Boolean ABCVendorIsThisOurCard(RegEntryID *theID, UInt32 cardAddress);
- void ABCVendorDisableInterrupts(UInt16 whichIntsOff);
- void ABCVendorEnableInterrupts(UInt16 whichIntsOn);
- SInt32 ABCVendorRegisterMulticast(UInt8 *mcAddress);
- SInt32 ABCVendorUnregisterMulticast(UInt8 *mcAddress);
- void ABCVendorInitialize(RegEntryID *theID);
- void ABCVendorClose(void);
- void ABCVendorTransmitOnePacket(mblk_t *thePacket, UInt16 packetSize);
- OSErr ABCVendorCheckTransmitterStatus(UInt16 packetSize);
- SInt32 ABCVendorSetEthernetAddress(UInt8 *physicalAddress);
- void ABCVendorGetFactoryEthernetAddress(UInt8 *addressArray);
- InterruptMemberNumber ABCVendorISR(InterruptSetMember member, void *refCon, UInt32 theIntCount);
-
- void ABCVendorTransmitCompletion (
- FWCommandObjectID fwCommandObjectID,
- OSStatus commandStatus,
- UInt32 completionProcData);
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=reset
- #endif
-
- #if PRAGMA_IMPORT_SUPPORTED
- #pragma import off
- #endif
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif /* __HWSPECIFIC__ */
-